/* nixonFTP
 * FTP client version 0.1
 * Copyright (C) 2010 NIXON Development Corporation.
 * All rights reserved.
 * http://members.shaw.ca/nixon.com
*/

package nixonftp.ui;

import nixonftp.*;
import java.awt.Dimension;
import java.util.ArrayList;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.JScrollPane;
import nixonftp.list.NXDefaultListModel;

public class NXTransferDialog extends JDialog {
	public NXTransferDialog(JFrame owner, ArrayList errors) {
		super(owner, true);
		JList list = new JList();
		JScrollPane listScroll = new JScrollPane(list);
		NXDefaultListModel listModel = new NXDefaultListModel();
		list.setModel(listModel);
		for (int x = 0; x < errors.size(); x++) {
			NXQueueItem item = (NXQueueItem) errors.get(x);
			listModel.addElement("<html>" + item.error +
					  "<br><font color='#888888'>File: </font>" + item.fileName +
					  "<br><font color='#888888'>Local Folder: </font>" + item.localFolder +
					  "<br><font color='#888888'>Remote Folder: </font>" + item.remoteFolder +
					  "</html>");
		}
		add(listScroll);
		setSize(new Dimension(300, 400));
	}
}
